<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\InvoiceService;

class Invoice extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    /**
     * 添加抬头
     */
    public function add()
    {
        $data = $this->request->post();
        $res = InvoiceService::add($data);
        return json($res);
    }

    /**
     * 编辑抬头
     */
    public function edit()
    {
        $data = $this->request->post();
        $res = InvoiceService::edit($data);
        return json($res);
    }

    /**
     * 抬头列表
     */
    public function lst()
    {
        $data = $this->request->post();
        $res = InvoiceService::lst($data);
        return json($res);
    }

    /**
     * 抬头删除
     */
    public function del()
    {
        $data = $this->request->post();
        $res = InvoiceService::delete($data);
        return json($res);
    }

    /**
     * 订单列表
     */
    public function order_list()
    {
        $data = $this->request->post();
        $res = InvoiceService::getOrderLists($data);
        return json($res);
    }

    /**
     * 申请发票
     */
    public function apply()
    {
        $data = $this->request->post();
        $res = InvoiceService::applyInvoice($data);
        return json($res);
    }

    /**
     * 申请列表
     */
    public function apply_list()
    {
        $data = $this->request->post();
        $res = InvoiceService::getApplyLists($data);
        return json($res);
    }

    /**
     * 申请列表
     */
    public function apply_details()
    {
        $data = $this->request->post();
        $res = InvoiceService::getApplyDetails($data);
        return json($res);
    }
}